<?php
/**
 * dao logindao
 * @package app-member_lib_dao_member
 */
load_lib('/dao/member/basedao');
/**
 * dao logindao
 * @author pandajingjing
 * @package app-member_lib_dao_member
 */
class dao_member_logindao extends dao_member_basedao{

	/**
	 * 新增用户基础信息
	 * @param array $p_arrParam
	 * @return false/int
	 */
	static function addUserBase($p_arrParam){
		return parent::addData('user_base',$p_arrParam,'user_db');
	}

	/**
	 * 获取用户登录信息
	 * @param string $p_strUserName
	 * @param string $p_strLoginType
	 * @return array
	 */
	static function getUserLoginInfo($p_strUserName,$p_strLoginType){
		switch($p_strLoginType){
			case 'username':
				$strField='USERNAME';
				break;
			case 'email':
				$strField='EMAIL';
				break;
		}
		
		$strSQL='select USERID,USERNAME,USERPWD,LASTUPD from user_login where '.$strField.'=:'.$strField;
		$arrParam=array(
				$strField=>$p_strUserName
		);
		return self::executeSQL('user_db','user_base',$strSQL,$arrParam,'row',true);
	}

}